﻿@model Himall.Web.Areas.Admin.Models.HomeFloorDetail
@using Himall.Web.Areas.Admin.Models;
@using System.Linq;

<script src="~/Scripts/jquery.himallUpload.js"></script>
<script src="~/Scripts/jquery.hiMallDatagrid.js"></script>
<script src="~/Scripts/jquery.himallLinkage.nocreate.js"></script>
<script src="~/Scripts/jquery.productSelector.js"></script>
<script src="~/Areas/Admin/Scripts/pageSettings-floorDetail.js"></script>



<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <strong>楼层编辑</strong>
        <li><a href="./HomeFloor">管理</a></li>
        <li class="active"><a>编辑</a></li>
    </ul>

    <form class="form-horizontal" role="form">
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">楼层名称：</label>
            <div class="col-sm-3 form-control-static">
                <input class="form-control input-xs" type="text" id="FloorName" name="FloorName" value="@ViewBag.FloorName " />
            </div>
        </div>
        <div class="form-group">
            <label for="" class="col-sm-2 control-label">楼层小标题：</label>
            <div class="col-sm-3 form-control-static">
                <input class="form-control input-xs" type="text" id="SubName" name="SubName" value="@ViewBag.SubName " />
            </div>
        </div>

        <div class="form-group">
            <label for="" class="col-sm-2 control-label">文本模块：</label>
            <div class="col-sm-10">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>名称</th>
                            <th>跳转链接</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody type="textLink">
                        @foreach (var textLink in Model.TextLinks)
                        {
                            <tr type="textLink" name="@textLink.Id">
                                <td><input class="form-control input-xs" type="text" name="name" value="@textLink.Name" /></td>
                                <td><input class="form-control input-xs" type="text" name="url" value="@textLink.Url" /></td>
                                <td class="td-operate"><span class="btn-a"><a>删除</a></span></td>
                            </tr>
                        }
                    </tbody>
                </table>
                <a class="add-atrr" id="addTextLink"><span class="glyphicon glyphicon-plus-sign"></span>添加</a>&nbsp;<span>(最多增加8个)</span>
            </div>
        </div>
        @*<div class="form-group">
            <label for="" class="col-sm-2 control-label">品牌模块：</label>
            <div class="col-sm-10">
                <div class="choose-checkbox">
                    <div class="choose-selected">
                        <b class="fl">已选择：</b>
                        <span id ="selectedBrands"></span>
                        <a class="fr" href="javascript:void(0)">展开编辑</a>
                    </div>
                    <div class="scroll-box">
                        <ul class="checkbox-list clearfix">
                            <li>
                                @{IEnumerable<Himall.Model.BrandInfo> brands = ViewBag.Brands;}
                                @foreach (var brand in brands)
                                {
                                    <label class="checkbox-inline"><input type="checkbox" value="@brand.Id" name="brand" @(Model.Brands.FirstOrDefault(item => item.Id == brand.Id) == null ? "" : "checked")>@brand.Name</label>
                                }
                            </li>

                        </ul>
                    </div>
                    <div class="enter-choose"><input type="button" class="btn btn-primary btn-sm fr" name="brandBtn" value="确定" /></div>
                </div>
            </div>
        </div>*@

        <div class="form-group">
            <label for="" class="col-sm-2 control-label">关联品牌：</label>
            <div class="col-sm-10 brand-letter" id="id_tab">

            </div>
            <div class="col-sm-10 brand-group">
                <div class="checkbox-group">
                </div>
                <div id="id_s" class="choose-brand">
                    <span>已选择：</span>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="" class="col-sm-2 control-label">图片：</label>
            <div class="col-sm-10">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>区域 
								<div class="floor-ex-img">
									（<a class="ex-btn">区域划分图</a>）
									<img src="/Images/floor-img.jpg" />
								</div>
							</th>
                            <th>图片</th>
                            <th>跳转链接</th>
                        </tr>
                    </thead>
                    <tbody>
                            <tr>
                                <td>左一</td>
                                <td><div class="upload-img" id="one" url="@Model.ProductLinks.ElementAt(0).Url"></div></td>
                                <td><input class="form-control input-xs pLink" type="text" position="1" name="url" value="@Model.ProductLinks.ElementAt(0).Name" /></td>
                            </tr>
                        <tr>
                            <td>左二</td>
                            <td><div class="upload-img" id="two" url="@Model.ProductLinks.ElementAt(1).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="2" name="url" value="@Model.ProductLinks.ElementAt(1).Name" /></td>
                        </tr>
                        <tr>
                            <td>右一</td>
                            <td><div class="upload-img" id="three" url="@Model.ProductLinks.ElementAt(2).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="3" name="url" value="@Model.ProductLinks.ElementAt(2).Name" /></td>
                        </tr>
                        <tr>
                            <td>右二</td>
                            <td><div class="upload-img" id="four" url="@Model.ProductLinks.ElementAt(3).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="4" name="url" value="@Model.ProductLinks.ElementAt(3).Name" /></td>
                        </tr>
                        <tr>
                            <td>右三</td>
                            <td><div class="upload-img" id="five" url="@Model.ProductLinks.ElementAt(4).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="5" name="url" value="@Model.ProductLinks.ElementAt(4).Name" /></td>
                        </tr>
                        <tr>
                            <td>右四</td>
                            <td><div class="upload-img" id="six" url="@Model.ProductLinks.ElementAt(5).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="6" name="url" value="@Model.ProductLinks.ElementAt(5).Name" /></td>
                        </tr>
                        <tr>
                            <td>右五</td>
                            <td><div class="upload-img" id="seven" url="@Model.ProductLinks.ElementAt(6).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="7" name="url" value="@Model.ProductLinks.ElementAt(6).Name" /></td>
                        </tr>
                        <tr>
                            <td>右六</td>
                            <td><div class="upload-img" id="eight" url="@Model.ProductLinks.ElementAt(7).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="8" name="url" value="@Model.ProductLinks.ElementAt(7).Name" /></td>
                        </tr>
                        <tr>
                            <td>右七</td>
                            <td><div class="upload-img" id="nine" url="@Model.ProductLinks.ElementAt(8).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="9" name="url" value="@Model.ProductLinks.ElementAt(8).Name" /></td>
                        </tr>
                        <tr>
                            <td>右八</td>
                            <td><div class="upload-img" id="ten" url="@Model.ProductLinks.ElementAt(9).Url"></div></td>
                            <td><input class="form-control input-xs pLink" type="text" position="10" name="url" value="@Model.ProductLinks.ElementAt(9).Name" /></td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <input type="hidden" name="id" id="homeFloorId" value="@Model.Id" />
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="button" name="submit" class="btn btn-primary">保存楼层</button>
            </div>
        </div>
    </form>
</div>
